﻿/* Copyright 2010 Igor Francé
 * 
 * This file is part of ECMADoc (http://ecmadoc.codeplex.com).
 * 
 * ECMADoc is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License 
 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
 * 
 * ECMADoc is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along with ECMADoc. 
 * If not, see http://www.gnu.org/licenses/.
 */
namespace EcmaDoc.Core
{
	using System;
	using System.Collections.Generic;

	/// <summary>
	/// Represents a set of actions that operate on a <see cref="Project"/>, and together represent one operation.
	/// </summary>
	public class ProjectOperation
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="ProjectOperation"/> class.
		/// </summary>
		/// <param name="name">The name of this operation.</param>
		/// <param name="steps">The dictionary of actions (steps) that this operation contains.</param>
		public ProjectOperation(string name, IDictionary<string, Action> steps)
		{
			this.Name = name;
			this.Steps = new OrderedDictionary<string, Action>();

			foreach (string key in steps.Keys)
			{
				this.Steps.Add(key, steps[key]);
			}
		}

		/// <summary>
		/// Gets the name of this operation.
		/// </summary>
		public string Name { get; private set; }

		/// <summary>
		/// Gets the dictionary of actions (steps) that this operation contains.
		/// </summary>
		public OrderedDictionary<string, Action> Steps { get; private set; }
	}
}
